﻿using MediatR;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebMediaTRApi.Pipelines;
using WebMediaTRApi.WeatherForcasts.Querys;

namespace WebMediaTRApi.WeatherForcasts.Handlers
{
    public class NewUserHandler : INotificationHandler<NewUser>    
    {
        private readonly ILogger<NewUserHandler> _logger;

        public NewUserHandler(ILogger<NewUserHandler> logger)
        {
            _logger = logger;
        }
        public Task Handle(NewUser notification, CancellationToken cancellationToken)
        {
            //Save to log  
            Thread.Sleep(500);
            _logger.LogInformation(" ****  Save user in database  *****");
            return Task.FromResult(true);
        }
    }
}
